package com.bite.order.controller;


import com.bite.order.api.ProductAPI;
import com.bite.product.mode.ProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/feign")
@RestController
public class FeignController {
    @Autowired
    private ProductAPI productAPI;

    @RequestMapping("/o1")
    public String o1(Integer id) {
        return productAPI.p1(id);
    }

    @RequestMapping("/o2")
    public String o2(Integer id,String name) {
        return productAPI.p2(id,name);
    }


    @RequestMapping("/o3")
    public String o3() {
        ProductInfo productInfo = new ProductInfo();
        productInfo.setId(1);
        productInfo.setProductName("Tx");
        return productAPI.p3(productInfo);
    }


    @RequestMapping("/o4")
    public String o4() {
        ProductInfo productInfo = new ProductInfo();
        productInfo.setId(12);
        productInfo.setProductName("Tx1");
        return productAPI.p4(productInfo);
    }

}
